package com.zoro.interviewee.keywords;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 按类文件从上到下记
 * <pre>
 * 包:   package import
 * 类:   public private protected
 *       abstract
 *       class interview enum
 *       extend implements
 * 属性:  byte char short int long double float boolean
 *       static synchronized volatile transient
 *       final
 * 构造: super this new
 * 方法: try catch finally
 *       return void native throws throw
 * 流程:  if else for break while do continue switch case default
 * 值:   true false null
 * 其他:  assert instanceof
 * 保留:  goto  const
 * 声明精确浮点： strictfp
 * </pre>
 *
 * @author zhaoxingwu
 */
public abstract class KeyWords<K, V> extends HashMap<K, V> implements Map<K, V> {

    private static final String NAME = "name";
    public Map<String, String> map = new HashMap<>();
    protected List<String> list = null;
    volatile int a = 0;
    transient TestEnum te;
    boolean ds = false;

    public KeyWords() {
        super();
    }

    public static void main(String[] args) throws FileNotFoundException {
        byte a = 127;
        char b = '2';
        short c = 1;
        int d = 2;
        long e = 1L;
        double f = 5.0;
        float g = 5F;
        final boolean h = true;
        String st = System.currentTimeMillis()+"";
        long st2 = System.currentTimeMillis();
        new HashMap<String, String>();

        try {
            InputStream is = new FileInputStream("");
            throw new RuntimeException();
        } catch (Exception exception) {
            exception.printStackTrace();
        }finally {
            System.out.println("..");
        }

        if (System.currentTimeMillis() > 1) {
            for (int i = 0; i < 10; i++) {
                System.out.println(i);
                if (i > 5) {
                    break;
                }
            }
        }else {
            do {
                if (System.currentTimeMillis() < 2) {
                    continue;
                }
                System.out.println("a");
            } while (System.currentTimeMillis() < 10);
        }

        switch (st) {
            case "123" -> System.out.println("11");
            case "1233" -> System.out.println("113");
            default -> System.out.println(22);
        }

        assert st2 < 100;

    }

    public synchronized String testMethod(Object p) {
        System.out.println(p instanceof String);
        return this.te.name();
    }

    public native void nativeMethod();

}

enum TestEnum{

}

interface TestInterface{

}
